Object::guard

Section: ET++ method description (n)
Updated: automatically Fri Mar 1 10:54:57 1991
Index Return to Main Contents
 

NAME

Object::guard - instance method  

TEMPLATE

checkedPointer = ObjPtr guard(Class * class)  

SPECIFIERS

public  

DESCRIPTION

Checks whether this object is an instance of the class. If this is the case, then it returns the receiver, otherwise an error (category error) is issued, and the return value is nil.
This method is usually not directly called. The macro Guard is the interface for this method, since the macro's value has the static type of (<class> *). Thus, the client does not need to cast the expresson. See also macro IsKindOf.
This method and therefore the macro Guard and the macro IsKindOf require that class descriptors are properly set up .
See also technote Metaclasses.  

ARGUMENTS

Class * class

the class descriptor of the class which the receiver shall be instance of.
Class descriptors may be literally denoted with the
macro Meta. For example, Meta(Window) if the desired class is Window.
 

RETURN ARGUMENT

ObjPtr checkedPointer

 

CATEGORIES

metaclass, implementation

 

FILES

implementation:
Object.C


 

Index

NAME
TEMPLATE
SPECIFIERS
DESCRIPTION
ARGUMENTS
RETURN ARGUMENT
CATEGORIES
FILES

This document was created by man2html, using the manual pages.
Time: 00:40:25 GMT, March 30, 2022